package com.meilele.dao.zhengchao;

import com.meilele.entity.zhengchao.FourCommit;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface FourCommitMapper {
    @Delete({
        "delete from four_commit",
        "where commit_id = #{commitId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer commitId);

    @Insert({
        "insert into four_commit (commit_id, username, ",
        "commit_upload_date, commit)",
        "values (#{commitId,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, ",
        "#{commitUploadDate,jdbcType=TIMESTAMP}, #{commit,jdbcType=LONGVARCHAR})"
    })
    int insert(FourCommit record);

    int insertSelective(FourCommit record);

    @Select({
        "select",
        "commit_id, username, commit_upload_date, commit",
        "from four_commit",
        "where commit_id = #{commitId,jdbcType=INTEGER}"
    })
    @ResultMap("com.meilele.dao.zhengchao.FourCommitMapper.ResultMapWithBLOBs")
    FourCommit selectByPrimaryKey(Integer commitId);

    int updateByPrimaryKeySelective(FourCommit record);

    @Update({
        "update four_commit",
        "set username = #{username,jdbcType=VARCHAR},",
          "commit_upload_date = #{commitUploadDate,jdbcType=TIMESTAMP},",
          "commit = #{commit,jdbcType=LONGVARCHAR}",
        "where commit_id = #{commitId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(FourCommit record);

    @Update({
        "update four_commit",
        "set username = #{username,jdbcType=VARCHAR},",
          "commit_upload_date = #{commitUploadDate,jdbcType=TIMESTAMP}",
        "where commit_id = #{commitId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(FourCommit record);
}